package com.guoqiang.method;

public class MethodParameter01 {
    public static void main(String[] args) {
        int a = 10;
        int b = 20;
        //创建AA对象，名字obj
        AAA obj = new AAA();
        obj.swap(10, 20);
        System.out.println("a = " + a + "\tb=" + b);
    }
}

class AAA {
    public void swap(int a, int b) {
        System.out.println("\na和b交换前的值为a=" + a + "\tb=" + b);
        int tmp = a;
        a = b;
        b = tmp;
        System.out.println("\na和b交换后的值为a=" + a + "\tb=" + b);
    }
}

